package com.chief.openfeign.controller;

import com.chief.openfeign.OpenFeignTestService;
import com.chief.openfeign.gateway.OpenFeignGatewayTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class OpenFeignServiceTestController {

    @Autowired
    private OpenFeignGatewayTestService openFeignGatewayTestService;
    @Autowired
    private OpenFeignTestService openFeignTestService;

    @RequestMapping("/index")
    public Map<String, Object> test() {
        System.out.println("-----------------------");
        Map<String, Object> res = new HashMap<>();
        res.put("a", "b");
        res.put("test", openFeignTestService.openFeignTest("001"));
        res.put("gateway", openFeignGatewayTestService.test());
        return res;
    }
}
